﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'SearchVehiculoAlquiladoFull')
	BEGIN
		DROP  Procedure  SearchVehiculoAlquiladoFull
	END

GO

CREATE Procedure SearchVehiculoAlquiladoFull

	(
		@descripcion nvarchar(100)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	VA.[Contrato],
	VA.[IdBien],
	VA.[IdVehiculoAlquilado],
	VA.[MontoPago]
	FROM [VehiculoAlquilado] AS VA
	INNER JOIN Vehiculo AS V ON VA.[IdBien] = V.[IdBien]
	WHERE (V.[NroPlaca] + ' / ' + V.[Modelo] + ' / ' + V.[Marca]) = @descripcion

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON SearchVehiculoAlquiladoFull TO PUBLIC

GO


